import request from '@/utils/request'

// 查询发货通知单列表
export function listConsignment(query) {
  return request({
    url: '/system/consignment/list',
    method: 'get',
    params: query
  })
}

// 查询发货通知单详细
export function getConsignment(consignmentId) {
  return request({
    url: '/system/consignment/' + consignmentId,
    method: 'get'
  })
}

// 新增发货通知单
export function addConsignment(data) {
  return request({
    url: '/system/consignment',
    method: 'post',
    data: data
  })
}

// 修改发货通知单
export function updateConsignment(data) {
  return request({
    url: '/system/consignment',
    method: 'put',
    data: data
  })
}

// 删除发货通知单
export function delConsignment(consignmentId) {
  return request({
    url: '/system/consignment/' + consignmentId,
    method: 'delete'
  })
}
//审核/反审核生产工单
export function updateAudit(consignmentId) {
  return request({
    url: '/system/consignment/audit/' + consignmentId,
    method: 'put'
  })
}
//结案/反结案生产工单
export function updateClose(consignmentId) {
  return request({
    url: '/system/consignment/close/' + consignmentId,
    method: 'put'
  })
}
export function syncData() {
  return request({
    url: '/system/consignment/syncData',
    method: 'post'
  })
}
